home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC-SIG: World of Games
/
PC-SIG World of Games (CDRM1080710) (1993).iso
/
ENT
/
DISK0035.ZIP
/
HOBBIT.BAS
< prev
next >
Wrap
BASIC Source File
|
1980-01-01
|
12KB
|
331 lines
1 'COPYRIGHT (C) CLOAD 1979
2 'K. WILLIAMS, 3250 VERMONT SW, GRANDVILLE, MI 49418
5 RANDOMIZE(348)
8 DEFINT A-Z
10 DIM H(9,9),M(9,9),A(7),D(14),AC(7),Z(4)
20 A$="RUBY RED NORN STONEPALE PEARLOPAL EYE BLUE FLAMEPALANTIR SILMARILL "
30 D$="SCHLOCK YNGVI GOLLUM MARDUK LOKI AZATOTH DAGON FENRIS ABRACAX SAURON CTHULHU SATAN "
40 CLS:PRINT"H O B B I T"
45 FOR Q=1 TO 3000:NEXT Q
50 CLS
100 INPUT"DO YOU WANT INSTRUCTIONS";O$
110 IF O$="YES" OR O$="Y" THEN 2220
120 INPUT"WHAT RATING (1-NOVICE 9-EXPERT)";N
130 N=INT(ABS(N)):IF N<1 OR N>9 THEN 120
140 FOR X=1 TO 9:FOR Y=1 TO 9:H(X,Y)=5:M(X,Y)=1:NEXT Y:NEXT X
190 REM PUT WARPS
200 B=20+RND*N
210 FOR Q=1 TO B
220 X=RND*9 :Y=RND*9 :R=RND*9 :S=RND*9
230 IF X=SANDY=R THEN 220
240 H(X,Y)=R*10+S:NEXT Q
260 REM PUT DEMONS
270 B=N+3
280 FOR Q=1 TO B
290 GOSUB 2440:H(X,Y)=-Q:D(Q)=1
300 NEXT Q
310 REM PUT AMULETS
320 FOR Q=1 TO 7
330 GOSUB 2440:H(X,Y)=Q*100:A(Q)=1
340 AC(Q)=3:NEXT Q
350 REM PUT RUNESTAFF
360 GOSUB 2440:H(X,Y)=-1*(RND*(N+3)):D(13)=1:Z(3)=X:Z(4)=Y
370 REM PUT ORB
380 GOSUB 2440:H(X,Y)=10*(RND*9)+(RND*9):Z(1)=X:Z(2)=Y:D(14)=1
390 REM PUT CURSES
400 FOR Q=1 TO 3:C(Q,1)=1:C(Q,2)=10:C(Q,3)=10:NEXT Q
430 IF N<7 THEN 470
440 FOR Q=1 TO N-6:GOSUB 2440:C(Q,2)=X:C(Q,3)=Y:NEXT Q
470 REM PUT FLARES AND ORACLE
480 GOSUB 2440:H(X,Y)=4:GOSUB 2440:H(X,Y)=2
490 REM PUT HOBBIT
500 GOSUB 2440:K=X:L=Y:PRINT"ALL RIGHT FUR-FOOT "
510 P=125+RND(12-N)
511 T=1:G=0:W=0:F=10:GOTO 1530
520 IF T>P THEN 2120
530 T=T+1
540 IF N<7 OR D(14)=0 THEN 650
550 IF C(1,1)=1 THEN 570
560 T=T+1
570 IF C(2,1)=1 THEN 590
580 G=G-(RND*5)
590 IF C(3,1)=1 OR A(5)=0 OR D(14)=0 THEN 610
595 PRINT:PRINT"'YOU ARE UNDER MY POWER NOW...'":FOR Q=1 TO 500:NEXT C
600 ON (RND*4) GOTO 810,830,850,870
610 FOR Q=1 TO 3
620 IF C(Q,2)<>K OR C(Q,3)<>L THEN 640
630 C(Q,1)=0
640 NEXT Q
650 PRINT:INPUT"YOUR MOVE";O$
651 CLS
660 IF O$="WAIT" OR O$="WT" THEN 1530
670 IF O$="NORTH" OR O$="N" THEN 810
680 IF O$="SOUTH" OR O$="S" THEN 830
690 IF O$="EAST" OR O$="E" THEN 850
700 IF O$="WEST" OR O$="W" THEN 870
710 IF O$="MAP" OR O$="M" THEN 890
720 IF O$="FLARE" OR O$="F" THEN 1110
730 IF O$="KILL" OR O$="K" THEN 2030
740 IF O$="LAMP" OR O$="L" THEN 1200
750 IF O$="QUIT" OR O$="Q" THEN 1460
760 IF O$="TELEPORT" OR O$="T" THEN 1420
770 PRINT"EVEN A STUPID HOBBIT LIKE YOU"
780 PRINT"CAN DO BETTER THAN THAT"
790 GOTO 520
800 REM NORTH
810 K=K-1
811 GOSUB 2460
812 GOTO 1530
820 REM SOUTH
830 K=K+1
831 GOTO 811
840 REM EAST
850 L=L+1
851 GOTO 811
860 REM WEST
870 L=L-1
871 GOTO 811
880 REM MAP
890 CLS:PRINT " 1 2 3 4 5 6 7 8 9"
891 PRINT " +---+-----+-----+-----+-----+-----+-----+-----+-----+"
892 FOR X=1 TO 9
893 PRINT X;"-| ";
900 FOR Y=1 TO 9
910 IF M(X,Y)>99 THEN 930
920 PRINT " ";
930 PRINT M(X,Y);" ";
940 IF M(X,Y)>9 OR M(X,Y)<-9 THEN 960
950 PRINT" ";
960 NEXT Y
970 PRINT
980 NEXT X:PRINT
985 PRINT"YOU ARE AT (";L;",";K;")":GOSUB 986:GOTO 520
986 IF G>-1 THEN 990
987 G=0
990 PRINT"YOU HAVE";G;"GEMS"
1000 PRINT"AND THESE AMULETS:"
1010 FOR Q=1 TO 7
1020 IF A(Q)=1 THEN 1040
1030 PRINT" ";MID$(A$,Q*10-9,10),
1040 NEXT Q
1050 IF D(13)=1 THEN 1070
1060 PRINT" RUNESTAFF",
1070 IF D(14)=1 THEN 1090
1080 PRINT" ORB OF ZOT";
1090 RETURN
1100 REM FLARE
1110 IF F>0 THEN 1140
1120 PRINT"EVEN A SCATTER-BRAINED HOBBIT LIKE YOU"
1130 PRINT"SHOULD KNOW WHEN HE IS OUT OF FLARES":GOTO 520
1140 F=F-1:X=K:Y=L
1150 FOR Q=-1 TO 1:FOR QQ=-1 TO 1:K=Q+X:L=QQ+Y
1151 GOSUB 2460
1159 M(K,L)=H(K,L)
1160 IF M(K,L)>99 THEN 1170:PRINT" ";
1170 PRINT M(K,L);" ";:IF M(K,L)>9 OR M(K,L)<0 THEN 1180:PRINT " ";
1180 NEXT QQ:PRINT:NEXT Q:K=X:L=Y:GOTO 520
1190 REM LAMP
1200 INPUT"WHICH DIRECTION DO YOU SHINE THE LAMP";O$:X=K:Y=L
1210 IF O$<>"NORTH" AND O$<>"N" THEN 1220
1211 Q=1:GOTO 1250
1220 IF O$<>"SOUTH" AND O$<>"S" THEN 1230
1221 Q=2:GOTO 1250
1230 IF O$<>"EAST" AND O$<>"E" THEN 1240
1231 Q=3:GOTO 1250
1240 IF O$<>"WEST" AND O$<>"W" THEN 770
1241 Q=4
1250 PRINT"THE MAGIC LAMP SHINES AND AT ";
1251 ON Q GOTO 1260,1270,1280,1290
1260 K=K-1:GOTO 1300
1270 K=K+1:GOTO 1300
1280 L=L+1:GOTO 1300
1290 L=L-1
1300 GOSUB 2460
1301 PRINT"(";L;",";K;") YOU SEE ";:M(K,L)=H(K,L)
1310 IF M(K,L)<0 THEN 1380
1320 IF M(K,L)>0 THEN 1330
1321 PRINT"AN EMPTY ROOM":GOTO 1365
1330 IF M(K,L)>2 THEN 1340
1331 PRINT"THE ORACLE":GOTO 1365
1340 IF M(K,L)>4 THEN 1350
1341 PRINT"THE SPARE FLARES":GOTO 1365
1350 IF M(K,L)>5 THEN 1360
1351 PRINT"GEMS":GOTO 1365
1360 IF M(K,L)>99 THEN 1370
1361 PRINT"A WARP"
1365 K=X:L=Y:GOTO 520
1370 PRINT"THE ";MID$(A$,(M(K,L)/100)*10-9,10):GOTO 1365
1380 PRINT MID$(D$,-M(K,L)*10-9,10)
1385 IF K=Z(3) AND L=Z(4) THEN 1365
1390 PRINT"AND HE IS SO ANGRY HE COMES AFTER YOU"
1400 H(X,Y)=H(K,L):M(X,Y)=M(K,L):M(K,L)=0:H(K,L)=0:K=X:L=Y:GOTO 1530
1410 REM TELEPORT
1420 IF D(13)=0 THEN 1440
1421 PRINT"LAME-BRAIN HOBBIT MUST BE SUICIDAL"
1430 PRINT"TO TRY AND TELEPORT WITHOUT THE RUNESTAFF":GOTO 520
1440 INPUT"X-COORD ";L:IF L<0 OR L>9 THEN 1440
1441 INPUT"Y-COORD ";K:IF K<0 OR K>9 THEN 1441
1450 FOR Q=1 TO 7:A(Q)=1:NEXT Q:G=0:M(K,L)=H(K,L):GOTO 1530
1460 REM QUIT
1470 INPUT "DID YOU REALLY WANT TO QUIT";O$:IF O$="YES" OR O$="Y" THEN W=1:GOTO 1481
1480 PRINT"THEN DON'T SAY YOU DO":GOTO 520
1481 PRINT:IF D(14)=0 AND W=1 THEN PRINT"WELL, LITTLE HOBBIT, YOU WON THIS ONE" ELSE PRINT "TOO BAD YOU DIDN'T WIN, HOBBIT"
1482 PRINT:GOSUB 986
1483 PRINT:PRINT"AND YOU KILLED THESE DEMONS:":Q=0
1484 Q=Q+1:IF D(Q)=0 THEN PRINT MID$(D$,Q*10-9,10),
1485 IF Q<N+3 THEN 1484
1486 PRINT
1490 INPUT"DO YOU WANT TO PLAY AGAIN";O$
1491 IF O$<>"YES" AND O$<>"Y" THEN 1510
1500 PRINT"SOME HOBBITS NEVER LEARN":GOTO 100
1510 PRINT"MAYBE DUMB HOBBIT NOT SO DUMB AFTER ALL"
1520 GOTO 9999
1530 PRINT"YOU ARE AT (";L;",";K;")":M(K,L)=H(K,L)
1540 IF M(K,L)<0 THEN 1850
1550 IF M(K,L)=0 THEN 1650
1560 IF M(K,L)=2 THEN 1660
1570 IF M(K,L)=4 THEN 1630
1580 IF M(K,L)=5 THEN 1620
1590 IF M(K,L)<100 THEN 1790
1600 PRINT"WHERE YOU FIND ";MID$(A$,M(K,L)/10-9,10):A(M(K,L)/100)=0:GOTO 1640
1620 Q=(RND*5):H(K,L)=0:M(K,L)=0:G=G+Q:IF G>=0 THEN 1622
1621 G=Q
1622 PRINT"HERE YOU FIND";Q;"GEMS"
1623 PRINT"YOU NOW HAVE";G;"GEMS":GOTO 520
1630 F=F+10:PRINT"HERE YOU FIND THE SPARE FLARES"
1640 H(K,L)=0:M(K,L)=0:GOTO 520
1650 PRINT"LOTS OF HOBBIT TRACKS IN THE DUST":GOTO 520
1660 PRINT"YOU ARE IN THE PRESENCE OF THE ORACLE"
1670 IF A(4)=1 THEN 1690
1680 PRINT"THE OPAL EYE COMPELS IT TO ANSWER A QUESTION":GOTO 1720
1690 IF G>19 THEN 1700
1691 PRINT"BUT YOU ARE TOO POOR TO ASK ANYTHING":GOTO 520
1700 INPUT"WILL YOU SPEND 20 GEMS FOR 1 QUESTION";O$
1710 IF O$<>"YES" AND O$<>"Y" THEN 550 ELSE G=G-20
1720 PRINT"WHAT WOULD YOU KNOW THE LOCATION OF":X=0:Y=0
1730 INPUT"(EX: TO FIND THE OPAL EYE TYPE 400)";Q
1740 FOR R=1 TO 9:FOR S=1 TO 9:PRINT"MUMBLE ";:IF H(R,S)<>Q THEN 1760
1750 IF Q<>0 THEN M(R,S)=H(R,S):X=R:Y=S:Q=0
1760 NEXT S:NEXT R:PRINT:PRINT
1770 IF X<>0 THEN 1780 ELSE PRINT"EVEN THE ORACLE DOES NOT KNOW WHERE THAT IS":GOTO 550
1780 PRINT"THAT WHICH YOU DESIRE WILL BE FOUND AT (";Y;",";X;")":GOTO 550
1790 IF K<>Z(1) OR L<>Z(2) THEN 1830
1800 IF O$<>"TELEPORT" AND O$<>"T" THEN 670
1810 PRINT"OH WOW!!":PRINT"LUCKY HOBBIT NOW HAS THE MIGHTY ORB OF ZOT!"
1820 H(K,L)=0:M(K,L)=0:D(14)=0:GOTO 520
1830 Q=INT(M(K,L)/10):K=M(K,L)-(Q*10):L=Q
1831 G=G-(RND*5):IF G>-1 THEN 1530 ELSE G=0:GOTO 1530
1840 REM DEMON
1850 IF K<>Z(3) OR L<>Z(4) THEN 1870
1860 PRINT"BOLD HOBBIT THIEF NOW HAS THE RUNESTAFF":H(K,L)=0:M(K,L)=0:D(13)=0:GOTO 520
1870 M(K,L)=H(K,L):IF M(K,L)>-1 THEN 1530
1871 PRINT"UH OH - YOU JUST RAN INTO ";MID$(D$,ABS(M(K,L))*10-9,10):Q=0
1880 Q=Q+1:IF A(Q)=0 THEN 2010
1881 IF Q<7 THEN 1880
1890 INPUT"HOW MUCH OF A BRIBE DO YOU OFFER HIM";B:PRINT
1900 IF B>0 THEN 1930
1901 PRINT"NORMALLY ";MID$(D$,-M(K,L)*10-9,10);" WOULD EAT YOU,"
1910 PRINT"BUT HE IS AFRAID THAT YOU ARE SICK OR SOMETHING"
1920 PRINT"SO TEARS YOU INTO SHREDS INSTEAD":GOTO 1481
1930 IF B=INT(B) THEN 1960
1940 PRINT MID$(D$,-M(K,L)*10-9,10);" DOESN'T UNDERSTAND DECIMALS,"
1950 PRINT"SO HE EATS CONFUSING LITTLE FUR-FOOT":GOTO 1481
1960 IF B<=G THEN 1990
1970 PRINT MID$(D$,-M(K,L)*10-9,10);" DOESN'T LIKE HOBBITS WHO OFFER MORE GEMS"
1980 PRINT"THAN THEY HAVE, SO HE EATS YOU":GOTO 1481
1990 G=G-B:IF B>(RND*(-M(K,L))) THEN PRINT"HE TAKES YOUR BRIBE":GOTO 550
1991 PRINT"THAT WASN'T ENOUGH, SO HE EATS YOU":GOTO 1481
2010 PRINT"BUT THE ";MID$(A$,Q*10-9,10);" PROTECTS YOU":GOTO 520
2020 REM KILL
2030 IF M(K,L)<0 THEN 2040
2031 PRINT"YOU HAVE TO FIND A DEMON TO KILL IT":GOTO 520
2040 PRINT"WHICH AMULET DO YOU ATTACK WITH"
2050 INPUT"(EX: OPAL EYE = 400)";Q:IF Q>700 THEN 2050
2051 Q=Q/100:IF A(Q)=0 THEN 2053
2052 PRINT"YOU DON'T POSSESS THAT ONE, STUPID!":GOTO 520
2053 IF AC(Q)>0 THEN 2055
2054 PRINT "THE ";MID$(A$,Q*10-9,10);" IS RECHARGING":GOTO 520
2055 AC(Q)=AC(Q)-1
2060 REM
2070 PRINT"THE ";MID$(A$,Q*10-9,10);" ATTACKS AND ";MID$(D$,-M(K,L)*10-9,10);
2080 IF (RND*Q)+3>(RND*-M(K,L)) THEN 2090
2081 PRINT" IS STAGGERED BUT NOT DEAD":GOTO 520
2090 PRINT" DIES":B=(RND*50):D(-M(K,L))=0:G=G+B:M(K,L)=0:H(K,L)=0
2100 PRINT"AND HERE IS HIS HOARD OF";B;"GEMS":GOTO 520
2110 REM WIZBACK
2120 IF W>0 THEN 2150
2121 PRINT"OH NO!!!"
2130 PRINT"THE WIZARD HAS RETURNED": IF D(14)=1 THEN 2170
2140 PRINT"BUT THE ORB OF ZOT PROTECTS YOU - FOR NOW":W=RND(9):GOTO 650
2150 W=W-1:IF W<>0 THEN 650 ELSE PRINT "SOME HOBBITS KNOW WHEN TO QUIT"
2160 PRINT "YOU DIDN'T."
2170 PRINT "WHAT A DELICIOUS LOOKING TOAD YOU MAKE":Q=0
2180 Q=Q+1
2181 IF D(Q)=1 THEN 2190
2182 IF Q=12 THEN 2200
2183 GOTO 2180
2190 PRINT"AND YOU GET FED TO ";MID$(D$,Q*10-9,10):GOTO 1481
2200 PRINT"AND YOU GET STEPPED ON BY THE WIZARD"
2210 PRINT" S Q U I S H ! !":GOTO1481
2220 PRINT"IN THIS GAME YOU BECOME A HOBBIT THIEF"
2222 PRINT"TRYING TO STEAL THE ORB OF ZOT FROM"
2224 PRINT"THE CASTLE OF THE EVIL WIZARD."
2226 INPUT"HIT ENTER TO CONTINUE";O$:CLS
2228 PRINT"THE CASTLE IS A (9 X 9) MATRIX FILLED"
2230 PRINT"WITH MANY THINGS. AMONG THESE"
2232 PRINT"THINGS (FOLLOWED BY THEIR NUMERIC REPRESENTATION"
2234 PRINT"ON THE MAP) ARE:"
2236 PRINT"GEMS (5), WARPS (11 THRU 99), SPARE FLARES (4)"
2238 PRINT"DEMONS (-1 THRU -12), AN ORACLE (2), AND"
2240 PRINT"AMULETS (100 THRU 700)."
2242 INPUT"HIT ENTER TO CONTINUE";O$:CLS
2244 PRINT"ALSO HIDDEN IN THE CASTLE ARE THE RUNESTAFF"
2246 PRINT"AND THE ORB OF ZOT. THE ORB IS DISGUISED "
2248 PRINT"AS A WARP AND THE ONLY WAY TO GET IT IS"
2250 PRINT"TO TELEPORT INTO ITS ROOM DIRECTLY."
2252 PRINT"IF YOU TRY TO MOVE INTO ITS ROOM YOU WILL"
2254 PRINT"GO PAST IT IN THE SAME DIRECTION."
2256 PRINT"TO TELEPORT YOU MUST USE THE RUNESTAFF"
2258 PRINT"WHICH IS DISGUISED AS A DEMON. BE CAREFUL"
2260 PRINT"WHEN YOU TELEPORT, HOWEVER, BECAUSE YOU LOSE"
2262 PRINT"ALL YOUR AMULETS AND GEMS (NOTE: YOU MAY ALSO"
2263 PRINT"DROP SOME GEMS EACH TIME YOU MOVE)."
2264 INPUT"HIT ENTER TO CONTINUE ";O$:CLS
2266 PRINT"FIND THE ORB AS QUICKLY AS YOU CAN BECAUSE"
2268 PRINT"THE WIZARD WILL RETURN SHORTLY AND ONLY THE"
2270 PRINT"ORB CAN PREVENT HIM FROM DOING TERRIBLE THINGS"
2272 PRINT"TO YOU."
2280 REM
2290 INPUT"HIT ENTER TO CONTINUE";O$:CLS
2291 PRINT"THE LEGAL MOVES ARE:"
2300 PRINT"NORTH OR N"
2310 PRINT"SOUTH OR S"
2320 PRINT"EAST OR E"
2330 PRINT"WEST OR W"
2340 PRINT"WAIT OR WT"
2350 PRINT"MAP OR M"
2360 PRINT"FLARE OR F"
2370 PRINT"LAMP OR L"
2380 PRINT"TELEPORT OR T"
2390 PRINT"KILL OR K"
2400 PRINT"QUIT OR Q"
2410 INPUT"HIT ENTER TO CONTINUE";O$:CLS
2420 GOTO 120
2430 REM A
2440 X=(RND*9):Y=(RND*9):IF H(X,Y)<>5 THEN 2440:RETURN
2450 REM B
2460 IF K>0 THEN 2470
2461 K=9
2470 IF K<10 THEN 2480
2471 K=1
2480 IF L>0 THEN 2490
2481 L=9
2490 IF L<10 THEN 2500
2491 L=1
2500 RETURN
9999 CLS:RUN "MENU.PGM"
65399 '** DONE - PRESS ENTER TO RETURN TO MENU **
=9
2490 IF L<10 THEN 2500
2491 L=1
2500 R